<?php
/**
 * Created by PhpStorm.
 * User: Inhere
 * Date: 2015/2/7
 * Time: 15:36
 * Use :
 * File: DispatcherServiceProvider.php
 */

namespace ulue\base\providers;


use ulue\core\event\Dispatcher;
use ulue\core\ioc\Container;
use ulue\core\ioc\InterfaceServiceProvider;

class DispatcherServiceProvider implements InterfaceServiceProvider
{
    /**
     * 注册事件服务提供者， EventServiceProvider
     * @param  Container $container 传入容器
     * @throws \DInvalidArgumentException
     * @return mixed|void
     */
    public function register(Container $container)
    {
        $container->share('dispatcher',
            function(Container $container)
            {
                return new Dispatcher();
            }
            )->alias('system.dispatcher')->alias('application.dispatcher');
    }
}// end class DispatcherServiceProvider